﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:UI_Controls="clr-namespace:UI.Controls" x:Class="UI.Dialogs.ExceptionDialog"
    Title="Unhandled Exception" Height="400" Width="490" mc:Ignorable="d" SizeToContent="Height" ResizeMode="NoResize" >
    <Grid x:Name="rootLayout">
        
    	<Grid.RowDefinitions>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition Height="*" />
    	</Grid.RowDefinitions>
    	<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" d:LayoutOverrides="Height" Margin="7,10,0,10"><Run Text="An unexpected error occurred. The application will try to continue it's work. If unusual things happen, please restart the application."/></TextBlock>
    	<ToggleButton x:Name="ShowDetails" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Content="Details..." Grid.Row="1" Margin="7,0,0,7" Checked="ToggleButton_Checked" Unchecked="ToggleButton_Checked" IsEnabled="False" />
    	<StackPanel HorizontalAlignment="Right" Grid.Row="1" Orientation="Horizontal" d:LayoutOverrides="Height" Margin="0,0,7,7">
    		<Button x:Name="Continue" VerticalAlignment="Top" Content="Continue" Margin="5,0,0,0" IsDefault="True" Click="Continue_Click" />
    		<Button x:Name="Terminate" VerticalAlignment="Top" Content="Terminate" Margin="5,0,0,0" Click="Terminate_Click" />
    	</StackPanel>
    	<StackPanel x:Name="ExceptionDetails" d:LayoutOverrides="Width" Grid.Row="2">
            <DockPanel>
    			<TextBlock VerticalAlignment="Top" Text="Exception details:" TextWrapping="Wrap" Margin="7,0" FontWeight="Bold" FontSize="13.333"/>
    			<Button HorizontalAlignment="Right" Content="Copy Message" DockPanel.Dock="Right" Margin="0,0,7,0" Click="CopyExceptionMessage_Click" />
    			<Button x:Name="CopyText" HorizontalAlignment="Right" Content="Copy" Margin="0,0,5,0" Click="CopyExceptionDetails_Click" DockPanel.Dock="Right" />
    		</DockPanel>
            <ScrollViewer Height="250">
                <TextBlock x:Name="ExceptionText" Text="Exception details" TextWrapping="Wrap" Margin="7,2,7,7" />
            </ScrollViewer>
    	</StackPanel>
        
    </Grid>
</Window>
